You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > VectorInt Structure > VectorInt Methods > SetSubRange Method > VectorInt.SetSubRange Method ([In] TMtxVecInt, [In] int, [In] int)
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
VectorInt.SetSubRange Method ([In] TMtxVecInt, [In] int, [In] int)

Define a subvector of the Src vector.

Syntax
C#
Visual Basic
public void SetSubRange([In] TMtxVecInt Src, [In] int Index, [In] int Len);

The method will define a subarray starting at Index and ending at Index+Len-1 of Src. No copying will occur, only pointers will be shifted or indices adjusted. 

A sub-vector/matrix is vector/matrix which does not neccessarily have its own memory allocated. Instead it adopts the memory of the source object and all operations done on the either of the objects affect the same elements. The use of subvectors/submatrices increases CPU cache reuse, lower's memory requirements, increases application performance and improves code readability. 

All values of the original TMtxVecBase will be preserved. An exception will be raised, if an attempt is made to change the size of calling object. No exception will be raised, if Src is resized while subranged. (possibly leading to memory overwrites) 

To again obtain a view of the original vector/matrix, call SetFullRange

Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!